// 封装图片错误时
export const imgerr = {
  inserted (el, bind) {
    el.addEventListener('error', function (e) {
      el.src = bind.value
    })
    // 图片地址为空时
    el.src = el.src || bind.value
  },
  componentUpdated (el, binding) {
    el.addEventListener('error', () => {
      // el.src = defaultUrl
      el.src = binding.value
    })
    el.src = el.src || binding.value
  }
}
